<template>
    <div>
        <router-link class="positionLook" to="/jobs">
            <p>看了该职位的人还看了</p>
            <p>
                <span>查看更多</span>
                <svg class="icon price-bottom-01" aria-hidden="true">
                <use xlink:href="#icon-zhankai1-copy-copy"></use>
                </svg>
            </p>
        </router-link>
        <!-- 职位信息列表 -->
        <div class="position-list">
            <!-- 每一条职位信息 -->
            <router-link class="position-item" :to="'/jobs/detail/'+item.id" v-for="(item,index) in recjobsData" :key="index">
                <p class="p1">
                    <span>{{item.name}}   {{item.nature}}</span>  <span>{{item.lowSalary}}</span>
                </p>
                <p class="p2">
                    <span class="p2-1">{{item.provinces}}</span><span class="fenge"></span>
                    <span class="p2-2">{{item.experience}}</span><span class="fenge"></span>
                    <span class="p2-3">{{item.degree}}</span><span class="fenge"></span>
                  
                    <span class="p2-4">{{item.addtime}}</span>
                </p>
                <p class="p3">
                    <span v-for="(tag,index2) in item.Arr_tags" :key="index2">{{tag}}</span>
                </p>
                <P class="p4"></P>
                <dl class="dl5">
                    <dt><img :src="item.Publisher.headportrait"/></dt>
                    <dd>
                        <p>{{item.Publisher.name}}</p>
                        <p>
                            <span>{{item.Publisher.workinglife}}人</span>
                            <span class="fenge02"></span>
                            <span>{{item.Publisher.industry}}</span>
                        </p>
                    </dd>
                </dl>
            </router-link>
        </div>
  </div>
</template>

<script>
import { getRecommendJob } from "@/api/jobs";

export default {
  data() {
    return {
      recjobsData: []
    };
  },
  props: {
    id: Number
  },
  beforeMount: function() {
    this.$nextTick(function() {
      this._getRecommendJob();
    });
  },
  methods: {
    // 获取数据
    _getRecommendJob() {
      this.$indicator.open();
      setTimeout(() => {
        getRecommendJob(this.id).then(res => {
          if (res.StatusCode === 200) {
            this.recjobsData = res.Data;
            this.$indicator.close();
          }
        });
      }, 400);
    }
  }
};
</script>


<style lang="scss" scoped>
.position-list {
  overflow: hidden;

  .position-item {
    display: block;
    padding-left: 11px;
    padding-right: 11px;
    padding-bottom: 15.3px;
    border-bottom: 8.3px solid #f4f4f4;
    // 第一行
    .p1 {
      overflow: hidden;
      margin-bottom: 12px;
      margin-top: 16px;
      > :first-child {
        color: #282828;
        font-size: 16px;
        display: block;
        float: left;
      }
      .p1-bolder {
        color: #282828;
      }
      > :last-child {
        color: #fd4f00;
        font-size: 16px;
        display: block;
        float: right;
        margin-right: 12px;
      }
    }
    // 第二行
    .p2 {
      overflow: hidden;
      margin-bottom: 13px;
      > span {
        display: block;
        float: left;
        color: #666666;
        font-size: 14px;
      }
      .p2-1 {
        margin-right: 9px;
      }
      .p2-2 {
        margin-right: 9px;
      }
      .p2-3 {
        margin-right: 9px;
      }
      .fenge {
        width: 0px;
        height: 12px;
        border: 1px solid #666666;
        margin-right: 10px;
        margin-top: 3.3px;
      }
      .p2-4 {
        float: right;
        margin-right: 12px;
      }
    }
    // 第三行
    .p3 {
      > span {
        font-size: 10px;
        color: #999999;
        padding: 5.3px 8.16px;
        border: 1px solid transparent;
        background: #f3f3f3;
        display: inline-block;
        margin-right: 11px;
      }
    }
    //第四行虚线
    .p4 {
      height: 0px;
      margin: 12px auto;
      border: 1px dashed #eeeeee;
    }
    // 第五个dl列表
    .dl5 {
      overflow: hidden;
      height: 55px;
      margin: 0;
      // 图片设置
      > dt {
        width: 40px;
        height: 40px;
        float: left;
        > img {
          max-width: 100%;
          max-height: 100%;
          vertical-align: middle;
        }
      }
      > dd {
        float: left;
        margin-left: 14px;

        > p {
          color: #999999;
          font-size: 14px;
          margin: 0;
        }
        :first-child {
          color: #282828;
          font-size: 14px;
          margin-bottom: 3px;
        }
        :last-child {
          overflow: hidden;
          > span {
            margin-bottom: 0;
            font-size: 12px;
            color: #999999;
            display: block;
            float: left;
          }
          .fenge02 {
            width: 1px;
            height: 11px;
            border: 1px solid #999999;
            margin-top: 3.51px;
            margin-left: 11px;
            margin-right: 11px;
          }
        }
      }
    }
  }
}
.salary-add {
  color: #fd4f00 !important;
}
// 看了该职位的人还看了
.positionLook {
  display: block;
  padding: 15px 12px;
  background: #f4f4f4;
  overflow: hidden;
  > :first-child {
    color: #999999;
    font-size: 14px;
    display: block;
    float: left;
  }
  > :last-child {
    font-size: 12px;
    color: #999999;
    display: block;
    float: right;
    overflow: hidden;
    > span {
      margin-right: 10px;
      display: block;
      float: left;
    }
    > .icon {
      float: left;
      display: block;
      margin-top: 3px;
    }
  }
}
</style>
